﻿namespace WpInsights.Core
{
    using System;
    using System.Xml.Serialization;

    [XmlRoot(ElementName = "module",Namespace = "")]
    public class Module
    {
        /// <summary>
        /// Required for serialization
        /// </summary>
        public Module()
        {
            this.DateModified = DateTime.UtcNow;
        }

        public Module(Version version)
        {
            // requried to pass xsd validation
            this.PdbPath = string.Empty;
            this.Path = string.Empty;
            this.Version = version;
        }

        [XmlElement("name")]
        public string Name { get; set; }

        [XmlElement("pdbPath")]
        public string PdbPath { get; set; } 
        
        [XmlElement("dateModified")]
        public DateTime DateModified { get; set; } 

        [XmlElement("version")]
        public Version Version { get; set; }

        [XmlElement("path")]
        public string Path { get; set; }
    }
}